public class test {
    public static void main(String[] args) {
        Thread t1=new Thread(()->{
            System.out.println("c");

        });
        Thread t2=new Thread(()->{
            try {
                t1.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("b");
        });
        Thread t3=new Thread(()->{
            try {
                t2.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("a");

        });
        t1.start();
        t2.start();
        t3.start();
    }
}
